﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DBUtility;
using System.Data.SqlClient;

public partial class BasicBase_SocLinke_DeptStat : System.Web.UI.Page
{
    public String rs = "";
    
    protected void Page_Load(object sender, EventArgs e)
    {
        SQLHelper db = new SQLHelper();
        SqlParameter[] parameters = {
                new SqlParameter("@depid", SqlDbType.VarChar, 7)
            };
        string depid=PublicFunction.GetRequstQueryString(Request, "depid");
        if (depid == "")
            depid = "1300000";
        parameters[0].Value = depid;
        DataTable dt = db.GetDatatableProcExcut("SocStatDep", parameters);
        string type="2";
        if(depid=="1300000")
            type="1";
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            if (i == 0)
                rs += "<tr class=\"grid_item\">" +
                    "<td align=\"left\" height=\"25\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=all'>" + dt.Rows[i][1].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A100'>" + dt.Rows[i][2].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A200'>" + dt.Rows[i][3].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A300'>" + dt.Rows[i][4].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A400'>" + dt.Rows[i][5].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A500'>" + dt.Rows[i][6].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A600'>" + dt.Rows[i][7].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A700'>" + dt.Rows[i][8].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=all'>" + dt.Rows[i][9].ToString() + "</a></td>" +
                  "</tr>";
            else
            {
                if (depid == "1300000")
                rs += "<tr class=\"grid_item\">" +
                    "<td align=\"left\" height=\"25\"><a href='DeptStat.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=all'>" + dt.Rows[i][1].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A100'>" + dt.Rows[i][2].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A200'>" + dt.Rows[i][3].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A300'>" + dt.Rows[i][4].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A400'>" + dt.Rows[i][5].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A500'>" + dt.Rows[i][6].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A600'>" + dt.Rows[i][7].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A700'>" + dt.Rows[i][8].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=all'>" + dt.Rows[i][9].ToString() + "</a></td>" +
                                  "</tr>";
                else
                    rs += "<tr class=\"grid_item\">" +
                    "<td align=\"left\" height=\"25\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=all'>" + dt.Rows[i][1].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A100'>" + dt.Rows[i][2].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A200'>" + dt.Rows[i][3].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A300'>" + dt.Rows[i][4].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A400'>" + dt.Rows[i][5].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A500'>" + dt.Rows[i][6].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A600'>" + dt.Rows[i][7].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=A700'>" + dt.Rows[i][8].ToString() + "</a></td>" +
                    "<td align=\"center\"><a href='SocLinkeList.aspx?depid=" + dt.Rows[i][0].ToString() + "&type=" + type + "&sort=all'>" + dt.Rows[i][9].ToString() + "</a></td>" +
                                  "</tr>";
            }
        }
    }
}
